<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2018/5/20
 * Time: 1:57
 */
header('Content-Type:application/json');
include '../classes/logincheck.php';
include '../classes/conn.php';
$class=$_POST['class'];
if(islogin()!='teacher_login') {
    die("error");
}

$files=array();
$query="select * from sharedfile where class='{$class}'";
$res=mysql_query($query);
while ($row=mysql_fetch_assoc($res)){
    $files[]=$row;
}

$data=json_encode($files);
echo $data;